import java.util.ArrayList;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        //获取或者设置list中的元素

        List<String> list = new ArrayList<>();
        list.add("aaa");
        list.add("bbb");
        list.add("ccc");
        list.add("ddd");//进行了自动扩容
        System.out.println(list.get(0));
        System.out.println(list.get(1));
        System.out.println(list.get(2));
        System.out.println(list.get(3));
        System.out.println(list.get(4));
    }
}
